package com.ellricky.baselib.adapter

import android.app.Activity
import com.andr.common.ui.adapter.BaseRecyclerAdapter
import com.andr.common.ui.adapter.SmartViewHolder
import com.ellricky.baselib.R
import com.ellricky.baselib.entity.RankEntity
import com.ellricky.baselib.entity.new.StaffRank
import com.ellricky.baselib.util.GlideUtil
import de.hdodenhof.circleimageview.CircleImageView

class RankAdapter(private val ctx: Activity) :
    BaseRecyclerAdapter<StaffRank>(R.layout.base_adapter_rank) {

    override fun onBindViewHolder(holder: SmartViewHolder, data: StaffRank, position: Int) {
        holder.text(R.id.tvRankNo, position.toString())
            .text(R.id.tvUserName, data.nama)
            .text(R.id.tvTotalNum, data.data)
        val cv: CircleImageView = holder.itemView.findViewById(R.id.ivAvatar)
        GlideUtil.into(ctx, data.head, cv)
    }
}